import axios from '@/libs/api.request'
// 查询字典项树状结构
export const queryDictByKeyApi = params => axios.request({
  url: `ids/data/type/${params.dictKey}`,
  method: 'get'
})

// 创建下一级
export const createDictNodeApi = data => axios.request({
  url: 'ids/data/type',
  method: 'post',
  data
})

// 更新节点信息
export const updateDictNodeApi = (params, data) => axios.request({
  url: `ids/data/type/${params.dictId}`,
  method: 'put',
  data
})

// 删除字典项（只能删除最底层节点）
export const deleteDictNodeApi = params => axios.request({
  url: `ids/data/type/${params.dictId}`,
  method: 'delete'
})
